package org.example.day9;

import org.apache.kafka.clients.producer.ProducerInterceptor;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.RecordMetadata;

import java.util.Map;

/**
 * @Description TODO
 * @Author 乐哥聊编程
 * @Date 2023/1/20 05:31
 */
public class CustomInterpreter implements ProducerInterceptor<String,String> {
    @Override
    public ProducerRecord<String, String> onSend(ProducerRecord<String, String> record) {
        System.out.println("onSend被回调");
        return record;
    }

    @Override
    public void onAcknowledgement(RecordMetadata metadata, Exception exception) {
        System.out.println("onAcknowledgement被回调");
    }

    @Override
    public void close() {
        System.out.println("close被回调");
    }

    @Override
    public void configure(Map<String, ?> configs) {
        System.out.println("configure被回调");
    }
}
